# find: 子字符串是否包含在字符串中, 如果存在返回 -1, 否则返回 -1
name = "bingbing"
print(name.find("i"))  # 1
print(name.find("bing"))  # 0
print(name.find("b", 3))  # 4
print(name.find("b", 5))  # -1
print(name.find("b", 3, 5))  # 4

# index
print(name.index("i"))  # 1
print(name.index("bing"))  # 0
print(name.index("b", 3))  # 4
# print(name.index("b",5))# ValueError: substring not found


## count
print(name.count("b"))  # 3

# replace
print(name.replace("b", "a"))  # aingainga
print(name)  # bingbing

# split
print(name.split("b"))  # ['', 'ing', 'ing']
print(type(name.split("ing")))  # ['', '', ''] # <class 'list'>


# capitalize
print(name.capitalize())  # Bingbing
print(name.upper())  # BINGBING
print(name.lower())  # bingbing

# startsWith
print(name.startswith("bing"))  # True
print(name.startswith("a"))  # False
print(name.startswith("a", 1))  # False

# endsWith
print(name.endswith("bing"))  # True
print(name.endswith("a"))  # False
print(name.endswith("a", 1))  # False

# isupper | islower
print(name.isupper())  # False
print(name.islower())  # True

# isdigit
print(name.isdigit())  # False

# isalpha
print(name.isalpha())  # True

skills = "js,python,vue,angular,react"
print(skills.split(","))  # ['js', 'python', 'vue', 'angular', 'react']
print(skills.split("!"))  # ['js,python,vue,angular,react']
print(skills.split(",", 1))  # ['js', 'python,vue,angular,react']

print("aaa".upper())  # AAA
print("AAA".lower())  # aaa
